<template>
  <div class="demo-type">
    <div>
      <el-avatar src="https://cube.elemecdn.com/0/88/03b0d39583f48206768a7534e55bcpng.png"></el-avatar>
      <el-dropdown>
        <span class="el-dropdown-link">张三<i class="el-icon-caret-bottom el-icon--right"></i></span>
        <el-dropdown-menu slot="dropdown">
          <el-dropdown-item ><span @click='oQuit'>退出</span></el-dropdown-item>
        </el-dropdown-menu>
      </el-dropdown>
    </div>
  </div>
</template>

<script>
  export default {
    data() {
      return {}
    },
    methods: {

      oQuit() {
        sessionStorage.clear();
        this.$router.push("/");
      }
    }
  }
</script>

<style scoped>
  .demo-type div {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .el-dropdown-link {
    cursor: pointer;
    color: #FFFFFF;
    margin: 0 .5vw;
    max-width: 10vw;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .el-icon-arrow-down {
    font-size: 0.75rem;
  }
</style>
